package com.dt.dubai.search.entity.bean;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.List;


/**
 * 搜索中的商品信息
 * Created by macro on 2018/6/19.
 */
@Data
@Document(indexName = "pms", type = "product", shards = 1, replicas = 0)
public class EsProductBean implements Serializable {
    private static final long serialVersionUID = -1L;
    @Id
    private Long id;

    private Long merchantBrandRecordId;
    private Long commodityTypeRecordId;
    private Long commodityAtbuRecordId;
    private String commodityCode;

    @Field(type = FieldType.Keyword)
    private Short commodityType;
    @Field(type = FieldType.Keyword)
    private Short releaseState;
    private Boolean newState;
    private Boolean recommendState;
    private Boolean verificationState;
    private Integer orderNum;

    //销量
    private Integer saleNum;

    //售价
    private Integer salePrice;

    //原价
    private Integer originalPrice;

    //单位
    private String unit;

    //重量
    private Integer weight;

    //赠送积分
    private Integer point;

    @Field(analyzer = "ik_max_word", type = FieldType.Text)
    private String commodityTitle;//商品标题
    @Field(analyzer = "ik_max_word", type = FieldType.Text)
    private String subTitle;  //子标题
    @Field(analyzer = "ik_max_word", type = FieldType.Text)
    private String description;
    private String commodityImages;


    //预告商品 0-否,1-是
    private Boolean yesPreview;

    //商品服务 1-无忧退货,2-快速退款,3-免费包邮
    private Short commodityService;

    //商品销售属性
    @Field(type = FieldType.Keyword)
    private String commodityInfoJson;

    //报告属性
    private String reportInfoJson;

    //备注
    private String remark;

    //产地
    @Field(analyzer = "ik_max_word", type = FieldType.Text)
    private String place;

    //审核 1-未提,2-审中,3-通过,4-驳回
    private Integer examineState;

    @Field(type = FieldType.Nested)
    private List<EsProductAttributeValueBean> attrValueList;

}
